﻿#region File Description

//-----------------------------------------------------------------------------
// ServiceObjects.cs
//
// Author: ITU Team3 (2012)
//-----------------------------------------------------------------------------

#endregion File Description

#region Using Statements

using System;
using System.Collections.Generic;
using System.Web;

#endregion

namespace rentit03_client.Session
{
    public static class SessionHandler
    {
        public static string Sid(this HttpContext current)
        {
            return current != null ? current.Session["Sid"].ToString() : String.Empty;
        }
    }
}

namespace rentit03_client.Models
{
    public class ReturnObj
    {
        public int Status { get; set; }

        public string Message { get; set; }

        public bool Success { get; set; }

        public string Value { get; set; }

        public override string ToString()
        {
            return "Status: " + Status + "\nMsg: " + Message + "\nSucces: " + Success + "\nVal: " + Value + "\n";
        }
    }

    public class MovieObj
    {
        public int Runtime { get; set; }

        public string ImdbId { get; set; }

        public string ImdbUrl { get; set; }

        public string Rated { get; set; }

        public int Id { get; set; }

        public string Type { get; set; }

        public string Updated { get; set; }

        public string Released { get; set; }

        public int Year { get; set; }

        public int Votes { get; set; }

        public float Rating { get; set; }

        public int RatingPercent { get; set; }

        public string Title { get; set; }

        public string Description { get; set; }

        public string CoverUrl { get; set; }

        public List<GenreObj> Genres { get; set; }

        public List<VersionObj> Versions { get; set; }

        public List<string> Images { get; set; }

        public List<string> Languages { get; set; }

        public List<CommentObj> Comments { get; set; }
    }

    public class VersionObj
    {
        public int Id { get; set; }

        public string Resolution { get; set; }

        public string Format { get; set; }

        public int Price { get; set; }

        public int? RentDays { get; set; }

        public int MediaId { get; set; }

        public MovieObj Movie { get; set; }
    }

    public class CommentObj
    {
        public int Id { get; set; }

        public int MediaId { get; set; }

        public string Comment { get; set; }

        public int UserId { get; set; }

        public string UserName { get; set; }

        public string Created { get; set; }
    }

    public class GenreObj
    {
        public string MediaType { get; set; }

        public string Name { get; set; }
    }

    public class ImageObj
    {
        public string Image { get; set; }
    }

    public class UserObj
    {
        public int Id { get; set; }

        public string Name { get; set; } // Available for services: CreateUser, EditUser(optional),

        public string Email { get; set; } // Available for services: CreateUser,

        public string Password { get; set; } // Available for services: CreateUser, EditUser(optional),

        public string Address { get; set; } // Available for services: CreateUser, EditUser(optional),

        public string PhoneNumber { get; set; } // Available for services: CreateUser, EditUser(optional),

        public int Credits { get; set; } // Available for services:

        public string Created { get; set; }

        //public DateTime Created { get; set; }
        public List<string> Roles { get; set; }

        public List<string> Permissions { get; set; }

        public UserObj()
        {
            Permissions = new List<string>();
            Roles = new List<string>();
        }
    }

    public struct OverviewMediaParemObj
    {
        public string Title { get; set; }

        public string ImdbId { get; set; }

        public string Genre { get; set; }

        public int YearFrom { get; set; }

        public int YearTo { get; set; }

        public string Description { get; set; }

        public int Count { get; set; }

        public int Page { get; set; }
    }

    public struct OverviewUserParemObj
    {
        public string Email { get; set; }

        public string Name { get; set; }

        public int? Page { get; set; }

        public int? Count { get; set; }
    }

    public class PermissionObj
    {
        public int Id { get; set; }

        public string Name { get; set; }
    }

    public class RoleObj
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public List<string> Permissions { get; set; }
    }

    public class ReceiptItemObj
    {
        public int MediaId { get; set; }

        public string Title { get; set; }

        public int VersionId { get; set; }

        public string Format { get; set; }

        public string DownloadUrl { get; set; }

        public int Cost { get; set; }
    }

    public class ReceiptObj
    {
        public List<ReceiptItemObj> Items { get; set; }

        public int TotalCost { get; set; }
    }
}